package cn.zdsoft.configuration.core.standalone;

import cn.zdsoft.configuration.core.ConfigContext;
import cn.zdsoft.configuration.core.api.IConfigClient;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by wangdongdong on 2018/8/17 16:39.
 */
public class StandaloneConfigContext implements ConfigContext {

    private IConfigClient configClient;

    private Map<String, Object> attrMap = new ConcurrentHashMap<>();


    @Override
    public void setConfigClient(IConfigClient configClient) {
        this.configClient = configClient;
    }

    @Override
    public IConfigClient getConfigClient() {
        return configClient;
    }

    @Override
    public void setAttribute(String str, Object obj) {
        attrMap.put(str, obj);
    }

    @Override
    public Object getAttribute(String str) {
        return attrMap.get(str);
    }
}
